package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
@Entity(name="Documento")
@Inheritance(strategy=InheritanceType.JOINED)

public class DocumentoEntity implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1633749933084357674L;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	protected int id;
	protected Date fecha;
	@OneToMany (cascade=CascadeType.ALL)
	@JoinColumn(name="idDocumento")
	protected List <ItemEntity>items = new ArrayList<ItemEntity>();
	public Date getFecha() {
		return fecha;
	}
	public void setFecha(Date fecha) {
		this.fecha = fecha;
	}
	public List<ItemEntity> getItems() {
		return items;
	}
	public void setItems(List<ItemEntity> items) {
		this.items = items;
	}
	public DocumentoEntity(int numero, Date fecha,
			List<ItemEntity> items) {
		super();
		this.id = numero;
		this.fecha = fecha;
		this.items = items;
	}
	public DocumentoEntity() {
		
	}
	
	

}
